package commande.outils;

public class Processus implements Comparable<Processus>
{
	private String nomProcessus;
	private String pid;
	
	public Processus()
	{
		this.nomProcessus = null;
		this.pid = null;
	}

	public String getNomProcessus() {return nomProcessus;}
	public void setNomProcessus(String nomProcessus) {this.nomProcessus = nomProcessus;}
	public String getPid() {return pid;}
	public void setPid(String string) {this.pid = string;}

	@Override
	public int compareTo(Processus o) 
	{
		if(o == null) return 1;
		
		if(this.pid == null && o.getPid() == null) return 0;
		if(this.pid == null && o.getPid() != null) return -1;
		
		return this.pid.compareTo(o.getPid());
	}
}
